package com.ke.bella.openapi.protocol.images;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.ke.bella.openapi.protocol.UserRequest;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.annotation.Nullable;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

@Data
@SuperBuilder
@NoArgsConstructor
@JsonInclude(Include.NON_NULL)
public class ImagesRequest implements UserRequest, Serializable {
    private static final long serialVersionUID = 1L;
    
    /**
     * A text description of the desired image(s). The maximum length is 32000 characters for gpt-image-1, 1000 characters for dall-e-2 and 4000 characters for dall-e-3.
     */
    @NotBlank
    private String prompt;
    
    /**
     * Allows to set transparency for the background of the generated image(s). This parameter is only supported for gpt-image-1. Must be one of transparent, opaque or auto (default value).
     */
    @Nullable
    private String background;
    
    /**
     * The model to use for image generation.
     */
    @NotBlank
    private String model;
    
    /**
     * Control the content-moderation level for images generated by gpt-image-1. Must be either low for less restrictive filtering or auto (default value).
     */
    @Nullable
    private String moderation;
    
    /**
     * The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.
     */
    @Nullable
    private Integer n;
    
    /**
     * The compression level (0-100%) for the generated images. This parameter is only supported for gpt-image-1 with the webp or jpeg output formats, and defaults to 100.
     */
    @Nullable
    private Integer output_compression;
    
    /**
     * The format in which the generated images are returned. This parameter is only supported for gpt-image-1. Must be one of png, jpeg, or webp.
     */
    @Nullable
    private String output_format;
    
    /**
     * The quality of the image that will be generated. hd creates images with finer details and greater consistency across the image. This param is only supported for dall-e-3.
     */
    @Nullable
    private String quality;
    
    /**
     * The format in which the generated images are returned. Must be one of url or b64_json.
     */
    @Nullable
    private String response_format;
    
    /**
     * The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 for dall-e-2. Must be one of 1024x1024, 1792x1024, or 1024x1792 for dall-e-3 models.
     */
    @Nullable
    private String size;
    
    /**
     * The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for dall-e-3.
     */
    @Nullable
    private String style;
    
    /**
     * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
     */
    @Nullable
    private String user;

    /**
     * 火山协议：是否在生成的图片中添加水印。
     */
    private Boolean watermark;

    /**
     * 火山协议：随机数种子，用于控制模型生成内容的随机性。取值范围为 [-1, 2147483647]。如果不提供，则算法自动生成一个随机数作为种子。如果希望生成内容保持一致，可以使用相同的 seed 参数值。
     */
    private Integer seed;

    /**
     * 火山协议：模型输出结果与prompt的一致程度，即生成图像的自由度；值越大，模型自由度越小，与用户输入的提示词相关性越强。取值范围：[1, 10] 之间的浮点数。
     */
    private Float guidance_scale;
}
